// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   ValidatorDupBean5.java

package include.validator;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;
import javax.servlet.http.HttpSession;

public class ValidatorDupBean5
{

	private boolean a;

	public ValidatorDupBean5()
	{
	}

	public boolean isDup(HttpSession session, String tn, String fn, String value, String values)
	{
		try
		{
			String unit_db_name = "";
			nseer_db db = new nseer_db("mysql");
			String sql1 = (new StringBuilder("select * from unit_info where unit_id='")).append(values).append("'").toString();
			ResultSet rs = db.executeQuery(sql1);
			if (rs.next())
				unit_db_name = rs.getString("unit_db_name");
			nseer_db db1 = new nseer_db(unit_db_name);
			String sql = (new StringBuilder("select * from ")).append(tn).append(" where ").append(fn).append("='").append(value).append("'").toString();
			rs = db1.executeQuery(sql);
			if (rs.next())
				a = true;
			else
				a = false;
			db.close();
			db1.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return a;
	}
}
